package edu.ielab.localansys.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

public class BatRunANSYS {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 try {
			 	String pathName = "D:/test";
			 	String ansysRun = "ansysrun.bat";
				File ansysRunFile = new File(pathName, ansysRun);
				String defaultAnsysCommand = "ansys";
				String ansysCommand = defaultAnsysCommand;
				PrintWriter cmdShell = new PrintWriter(new FileOutputStream(
						ansysRunFile));


				cmdShell.println("c: ");
				cmdShell.println("cd " + pathName);
				
				String shortFilename = "WHEELSETXX.MAC";
				cmdShell.println(ansysCommand + " -b " + "-i " + shortFilename
						+ " -o ansys_out.out");
				
				cmdShell.flush();
				cmdShell.close();


//				GenericUtil.runRemoteShellScriptWin("localhost", v, scratchDir);
//			Runtime.getRuntime().exec("D:\\Program Files\\ANSYS Inc\\v110\\ANSYS\\bin\\intel\\ansys100.exe");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}

}
